package com.baiye.www.utils;

import javax.servlet.http.HttpServletRequest;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: baiye
 * @Date: 2021/07/18/15:28
 * @Description:
 */
public class URLUtil {
    public static String pareRequestURI(HttpServletRequest request) {

        String path = request.getContextPath();
        String requestUri = request.getRequestURI();
        String midUrl = requestUri.replace(path, "");
        String lastUrl = midUrl.substring(0, midUrl.lastIndexOf("."));


        return lastUrl;
    }
}
